var express = require('express');
var bodyParser = require('body-parser');
// var app = express.createServer(); // express 2.x
var app = express();
app.use(bodyParser.json());
app.use(bodyParser.urlencoded());

// curl http://localhost:3000/
app.get('/', function(req, res) {
	res.end('hello world wzq');
});


//test: curl -d "name=1&b=2" http://localhost:3000/post
app.post('/post', function(req, res) {
	var name = req.body.name;
	console.log('name=' + name);
	res.end('bye');
});

app.listen(3000);
console.log('server linstening 3000....');